package com.qf.ssm.service.impl;
/*
   @author 86155
   @ClassName: com.qf.ssm.service.impl.ProductAppServiceImpl
   @Description: 该类的功能描述
   @date: 2021/10/12 14:52 
*/

import com.github.pagehelper.PageHelper;
import com.qf.ssm.entity.Product;
import com.qf.ssm.mapper.ProductAppMapper;
import com.qf.ssm.service.ProductAppService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductAppServiceImpl implements ProductAppService {

    @Resource
    private ProductAppMapper productAppMapper;
    /**
     * 分页展示优选商品
     *
     * @param page
     * @param size
     * @return
     */
    @Override
    public List<Product> findPreferred(Integer page, Integer size) {
        PageHelper.startPage(page, size);
        List<Product> products = productAppMapper.selectPreferred();
        return products;
    }


    @Override
    public Product findProductByPid(Long pid) {
        Product product = productAppMapper.selectProductByPid(pid);
        return product;
    }
}
